﻿<%@ Page Title="Anasayfa | TodayWho" Language="C#" MasterPageFile="~/Master.Master"
    AutoEventWireup="true" CodeBehind="home.aspx.cs" Inherits="TodayWho.home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="/scripts/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script>
    <script src="scripts/signupTipsHelper.js" type="text/javascript"></script>
    <script src="https://connect.facebook.net/tr_TR/all.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            //FB.init({ appId: '283575318389020', status: true, cookie: true, xfbml: true });
            FB.init({ appId: '274521685956429', status: true, cookie: true, xfbml: true });
            $("#imgFbLogin").click(function () {
                connect();
            });
        });


        function connect(RedirectUrl) {
            FB.getLoginStatus(function (response) {
                if (response.status == "connected") {
                    loginAsync();
                }
                else {
                    FB.login(function (response1) {
                        if (response1.status == "connected") {
                            loginAsync();
                        } else {
                            alert("Uygulamayı kullanmak için izin vermelisiniz");
                        }
                    }, { scope: 'email' });
                }
            });
        }

        function loginAsync() {
            FB.api('/me', function (response) {
                //alert(response.name+' '+response.email);
                $.ajax({
                    type: "POST",
                    url: "login.aspx/FbLogin",
                    data: "{'fbUserId':'" + FB.getUserID() + "','token':'" + FB.getAccessToken() + "','email':'" + response.email + "','name':'" + response.name + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        window.location = msg.d;
                    }
                });
            });
        }
        function showContent() {
            $("[id$='_errors']").hide();
            setTimeout("showErrorDiv();", 1);
        }

        function showErrorDiv() {
            if (Page_IsValid != null && Page_IsValid == false) {
                $("[id$='_lblErrors']").hide();
                $("[id$='_errors']").show();
            }
        }
    </script>
    <script type="text/javascript" language="javascript">
        function forgetPassword() {
            $("#loginContent").hide();
            $("#forgetPassword").show();
        }
        function forgetPasswordtoLogin() {
            $("#loginContent").show();
            $("#forgetPassword").hide();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" style="height:%100;">
    <div style="height: 900px; width: auto; background-color: #E2FFD5; background: url('/images/bg.jpg');
        padding-top: 25px">
        <div class="hitMain" id="Hits" style="margin-left: auto; margin-right: auto">
            <div class="hits" id="yesterday" style="float: left;">
                <div class="hits-title">
                    En Popüler - Dün
                </div>
                <div class="hits-content">
                    <div class="hits-image" style="border-right: 1px solid #6D6E6D;">
                        <a href="./popular.aspx">
                            <img src="/images/profilePics/profilepic1.jpg" title="" /></a>
                    </div>
                    <div class="hits-desc">
                        <a href="#">Mahmut Kafkas </a>
                    </div>
                    <div class="hits-category">
                        <div class="hits-category-image">
                            <img src="style/images/todaywho_tech.png"></div>
                        <div class="hits-category-name">
                            Tech</div>
                    </div>
                </div>
            </div>
            <div class="hits" id="lastweek" style="float: left;">
                <div class="hits-title">
                    En Popüler - Geçen Hafta
                </div>
                <div class="hits-content">
                    <div class="hits-image" style="border-right: 1px solid #6D6E6D;">
                        <a href="#">
                            <img src="/images/profilePics/profilepic2.jpg" title="" /></a>
                    </div>
                    <div class="hits-desc">
                        <a href="#">Ebru Yıldırımlı </a>
                    </div>
                    <div class="hits-category">
                        <div class="hits-category-image">
                            <img src="style/images/todaywho_sanat2.png"></div>
                        <div class="hits-category-name">
                            Sanat</div>
                    </div>
                </div>
            </div>
            <div class="hits" id="lastmonth" style="float: left;">
                <div class="hits-title">
                    En Popüler - Geçen Ay
                </div>
                <div class="hits-content">
                    <div class="hits-image">
                        <a href="#">
                            <img src="/images/profilePics/profilepic3.jpg" title="" /></a>
                    </div>
                    <div class="hits-desc">
                        <a href="#">Tevfik Oytun Aloğlu </a>
                    </div>
                    <div class="hits-category">
                        <div class="hits-category-image">
                            <img src="style/images/todaywho_tech.png"></div>
                        <div class="hits-category-name">
                            Tech</div>
                    </div>
                </div>
            </div>
        </div>
        <div id="mainLogin">
            <div id="signUp" style="float: left;">
                <asp:Panel ID="pnl" runat="server" DefaultButton="btnSignup">
                    <div class="homeSignup" style="float: left">
                        <div class="homeSignupTitle">
                            Şimdi hemen kaydolun
                        </div>
                        <table cellspacing="6px">
                            <tr>
                                <td class="homeSigunptdLabel">
                                    Eposta
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEmail" runat="server" CssClass="texts"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rqTxtEmail" runat="server" ControlToValidate="txtEmail"
                                        Display="Dynamic" ValidationGroup="vgCreatePage" ErrorMessage="Lütfen email adresini giriniz.">*</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="regMail" runat="server" ControlToValidate="txtEmail"
                                        ErrorMessage="Lütfen geçerli bir email adresi giriniz." ValidationGroup="vgCreatePage"
                                        ValidationExpression="^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$">*</asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="homeSigunptdLabel">
                                    Şifre
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" CssClass="texts"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rqTxtPassword" runat="server" ControlToValidate="txtPassword"
                                        Display="Dynamic" ValidationGroup="vgCreatePage" ErrorMessage="Lütfen şifrenizi giriniz.">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="homeSigunptdLabel">
                                    Kullanıcı Adı
                                </td>
                                <td style="font-size: 16px">
                                    <asp:TextBox ID="txtUserName" runat="server" CssClass="texts"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rqTxtUserName" runat="server" ControlToValidate="txtUserName"
                                        Display="Dynamic" ValidationGroup="vgCreatePage" ErrorMessage="Lütfen kullanıcı adını giriniz.">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="homeSigunptdLabel">
                                    Kategori
                                </td>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <img src="style/images/todaywho_genel.png">
                                            </td>
                                            <td>
                                                <img src="style/images/todaywho_muzik.png">
                                            </td>
                                            <td>
                                                <img src="style/images/todaywho_spor.png">
                                            </td>
                                            <td>
                                                <img src="style/images/todaywho_sanat2.png">
                                            </td>
                                            <td>
                                                <img src="style/images/todaywho_edebiyat.png">
                                            </td>
                                            <td>
                                                <img src="style/images/todaywho_tech.png">
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:RadioButtonList ID="rbListCategory" runat="server" RepeatDirection="Horizontal"
                                        CellPadding="3">
                                        <asp:ListItem id="genel" Text="" Value="1" Selected="True"></asp:ListItem>
                                        <asp:ListItem id="muzik" Text="" Value="2"></asp:ListItem>
                                        <asp:ListItem id="spor" Text="" Value="3"></asp:ListItem>
                                        <asp:ListItem id="sanat" Text="" Value="4"></asp:ListItem>
                                        <asp:ListItem id="edebiyat" Text="" Value="5"></asp:ListItem>
                                        <asp:ListItem id="tech" Text="" Value="6"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="right">
                                    <asp:Button ID="btnSignup" runat="server" CssClass="homeSignupButton" Text="Kaydol"
                                        OnClick="btnSignup_OnClick" ValidationGroup="vgCreatePage" OnClientClick="showContent();" UseSubmitBehavior="false" />
                                </td>
                            </tr>
                        </table>
                        
                    </div>
                </asp:Panel>
            </div>
            <div id="login" style="float: right;">
                <div id="loginContent" style="display: inline;">
                    <asp:Panel ID="Panel1" runat="server" DefaultButton="btnLogin" Style="display: inline;">
                        <div class="homeSignup" style="float: left">
                            <div class="homeloginTitle">
                                Üye Girişi
                            </div>
                            <table cellspacing="6px">
                                <tr>
                                    <td class="homeSigunptdLabel">
                                        Eposta
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEmail2" runat="server" CssClass="texts"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rqTxtEmail2" runat="server" ControlToValidate="txtEmail2"
                                            Display="Dynamic" ValidationGroup="vgLogin" ErrorMessage="Lütfen email adresini giriniz.">*</asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="regMail2" runat="server" ControlToValidate="txtEmail2"
                                            ErrorMessage="Lütfen geçerli bir email adresi giriniz." ValidationGroup="vgLogin"
                                            ValidationExpression="^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$">*</asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="homeSigunptdLabel">
                                        Şifre
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPassword2" runat="server" TextMode="Password" CssClass="texts"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rqTxtPassword2" runat="server" ControlToValidate="txtPassword2"
                                            Display="Dynamic" ValidationGroup="vgLogin" ErrorMessage="Lütfen şifrenizi giriniz.">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="color: #FFFFFF;">
                                        <asp:CheckBox ID="chkRememberMe" Text="Beni Hatırla" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="center">
                                        <asp:Label ID="Label1" runat="server" Visible="false" Font-Size="Small" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <div id="loginButtonPasswordContent">
                                <div id="loginButton" style="float: left; margin-left: 10px">
                                    <asp:Button ID="btnLogin" runat="server" CssClass="button" Text="Giriş" OnClick="btnLogin_OnClick"
                                        ValidationGroup="vgLogin" OnClientClick="showContent();"  UseSubmitBehavior="false"/></div>
                                <div id="forgetPasswordcontent" style="float: left; margin-left: 20px; padding-top: 15px">
                                    <a href="#" onclick="forgetPassword();" style="font-size: 12px; line-height: 1em;
                                        color: #D7D7D7; text-decoration: underline;">Şifremi unuttum</a>
                                </div>
                            </div>
                        </div>
                        <div class="spacer"></div>
                        <hr color="#D7D7D7" size="0.5" width="50%">
                        <div style="color: #D7D7D7; font-weight: bold; margin-left: 5px; margin-top: 10px;">
                            Facebook üyeliğinizle giriş yapmak isterseniz;</div>
                        <div style="margin-top: 5px; margin-left: 5px; margin-top: 10px;">
                            <img id="imgFbLogin" src="style/images/facebook-ile-baglan.png" alt='facebook_baglan'
                                style="cursor: pointer" /></div>
                        <p style="border-bottom: none"></p>
                           
                    </asp:Panel>
                </div>
                <div id="forgetPassword" style="display: none; margin-top: 20px;">
                    <div class="homeloginTitle">
                        Şifrenizi mi unuttunuz?
                    </div>
                    <asp:Panel ID="Panel2" runat="server" DefaultButton="btnChangePassword">
                        <table cellspacing="6px">
                            <tr>
                                <td colspan="3" class="homeSigunptdLabel">
                                    Lütfen Eposta adresinizi giriniz:
                                </td>
                            </tr>
                            <tr>
                                <td class="homeSigunptdLabel">
                                    Email
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEmail3" runat="server" CssClass="text"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rqTxtEmail3" runat="server" ControlToValidate="txtEmail3"
                                        Display="Dynamic" ValidationGroup="vgChangePassword" ErrorMessage="Lütfen email adresini giriniz.">*</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="regMail3" runat="server" ControlToValidate="txtEmail3"
                                        ErrorMessage="Lütfen geçerli bir email adresi giriniz." ValidationGroup="vgChangePassword"
                                        ValidationExpression="^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$">*</asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="btnChangePassword" runat="server" CssClass="button" Text="Gönder"
                                        OnClick="btnChangePassword_OnClick" ValidationGroup="vgChangePassword" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <a href="#" onclick="forgetPasswordtoLogin();" style="font-size: 12px; line-height: 1em;
                                        color: #D7D7D7; text-decoration: underline;">Giriş Sayfasına geri dönüş</a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <p style="border-bottom: none">
                                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="vgChangePassword"
                                        DisplayMode="BulletList" ShowSummary="true" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
            </div>
        </div>

        <div id="errors" runat="server" class="hitMain" style="margin-left: auto; margin-right: auto;height:auto;text-align:center;display:none;">
            <asp:Label ID="lblErrors" runat="server"  ForeColor="Red" style="display:none;"></asp:Label>
             
            <asp:ValidationSummary ID="vsumLogin" runat="server" ValidationGroup="vgLogin" DisplayMode="BulletList"
                ShowSummary="true" />
            <asp:ValidationSummary ID="vsumSignup" runat="server" ValidationGroup="vgCreatePage" DisplayMode="BulletList"
                ShowSummary="true" />
        </div>
        
    </div>
    <!-- 980'e 340 olacak -->
    <!-- hits -->
    <%--      <div style="float:left;background-color:#E2FFD5;width:690px;height:240px">
                
            </div>
            <div style="float:right;">
                 <iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FTodayWho%2F199763010061819&amp;width=300&amp;colorscheme=light&amp;show_faces=true&amp;stream=false&amp;header=false&amp;height=250" 
                    scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:250px;" allowTransparency="true">
                </iframe>
            </div>
        </div>--%>
</asp:Content>
